package cn.unknowpupil.init.configure.mybatisplus.base;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * 乐观锁 继承这个类 字段里面加上version 字段实现乐观锁
 * @Classname: VersionEntity
 * @Author: <a> w10g </a>
 * @CreateDate: Create in 2020/4/29 11:01
 * @Description:
 * @Version: 1.0
 */
@Data
@Accessors(chain = true)
public class VersionEntity <T extends Model<T>> extends SuperEntity<T> {
    @TableField(value = "version")
    @Version
    private Long version;
}
